package com.aibaixun.system.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.aibaixun.system.domain.RequestLog;
import com.aibaixun.system.service.RequestLogService;
import com.aibaixun.system.mapper.RequestLogMapper;
import org.springframework.stereotype.Service;

/**
* @author zhangyh
* @description 针对表【request_log】的数据库操作Service实现
* @createDate 2023-09-21 09:08:43
*/
@Service
public class RequestLogServiceImpl extends ServiceImpl<RequestLogMapper, RequestLog>
    implements RequestLogService{

    @Override
    public void recordResutData(String urlName, JSONObject jsonObject) {
        RequestLog requestLog = new RequestLog();
        requestLog.setRequestUrl(urlName);
        if(jsonObject == null){
            requestLog.setResultData(null);
        }else{
            requestLog.setResultData(jsonObject.toJSONString());
        }

        this.baseMapper.insert(requestLog);
    }
}




